<?php $this->widget('Categories'); ?>
<!-- /Categories -->

<div class="filter">
    <? echo CHtml::dropDownList('os', '', CHtml::listData($oss, 'id', 'name'), array(
        'empty' => 'Any Operation System',
        'class'=>'osFilter',
    )); ?>

    <? echo CHtml::dropDownList('size', '',
        array(
            '10' => '10 inches above',
            '9' => '9-10 inches',
            '8' => '8-9 inches',
            '7' => '7-8 inches',
            '6' => '7 inches below',
        ), 
        array(
            'empty' => 'Any Size',
            'class'=>'sizeFilter',
        )
    ); ?>
</div>
<!-- /Filter -->


<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemsCssClass'=>'product-list clearfix',
	'itemView'=>'_view',
	'template'=>'{items}<span class="loading"></span>{pager}',
    'id'=>'ajaxListView',
    'emptyText'=>'<span class="tips-empty">No results found.</span>'
)); ?>
<!-- /Product list -->

<?php
Yii::app()->clientScript->registerScript('osFilter',
    "$('.osFilter').change(function(){
        os = $('.osFilter').serialize();
        $.fn.yiiListView.update(
            'ajaxListView',
            {data: os}
        );
    });"
);
?>

<?php
Yii::app()->clientScript->registerScript('sizeFilter',
    "$('.sizeFilter').change(function(){
        size = $('.sizeFilter').serialize();
        $.fn.yiiListView.update(
            'ajaxListView',
            {data: size}
        );
    });"
);
?>

